<?php 
header("content-type:text/html;charset=utf-8");
$id=isset($_POST['id'])?$_POST['id']:'';
$name=isset($_POST['name'])?$_POST['name']:'';
$pwd=isset($_POST['pwd'])?$_POST['pwd']:'';
// print_r($name);die;
$dsn="mysql:host=127.0.0.1;dbname=zice;charset=utf8";
$db=new PDO($dsn,'root','root');
$sql="update user set name='$name',pwd='$pwd' where id=$id";
$res=$db->exec($sql);
if($res){
	echo "<script>alert('修改成功');location.href='show.php';</script>";
}else{
	echo "<script>alert('修改失败');location.href='show.php';</script>";
}























 ?>